Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(automerge): implement exponential backoff #181

Merged
merged 7 commits into from
May 24, 2024

Conversation

Ben10k
Copy link
Contributor

@Ben10k Ben10k commented May 23, 2024

Description

Retry mechanism with exponential backoff is implemented for automatically merging PRs.

Resolves #176

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

go.mod Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@@ -711,7 +738,7 @@ func createCommit(ghPrClientDetails GhPrClientDetails, treeEntries []*github.Tre
Tree: tree,
}

commit, resp, err := ghPrClientDetails.GhClientPair.v3Client.Git.CreateCommit(ghPrClientDetails.Ctx, ghPrClientDetails.Owner, ghPrClientDetails.Repo, newCommitConfig)
commit, resp, err := ghPrClientDetails.GhClientPair.v3Client.Git.CreateCommit(ghPrClientDetails.Ctx, ghPrClientDetails.Owner, ghPrClientDetails.Repo, newCommitConfig, nil)
Copy link
Contributor Author

@Ben10k Ben10k May 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateCommit's signature has changed since GH client v52 that requires an additional parameter for CreateCommitOptions which is used for signing commits

@Ben10k
Copy link
Contributor Author

Ben10k commented May 23, 2024

I'll fix the linting error, most likely tomorrow.
ot sure what to do with the failing docker build?

@Oded-B
Copy link
Collaborator

Oded-B commented May 23, 2024

Yeah, the docker build is unrelated.
I'll try to take a look, but I will not block this pr if it's the only issue, worst case I'll validate it locally

@Ben10k
Copy link
Contributor Author

Ben10k commented May 24, 2024

@Oded-B linting issues fixed, can you approve workflows and tale a look?

@Oded-B Oded-B merged commit 55bcc24 into wayfair-incubator:main May 24, 2024
3 of 4 checks passed
Oded-B referenced this pull request in commercetools/telefonistka Jun 12, 2024
* Add pagination to "List files in PR" api call (#174)

* Support pagination for "List files in PR" API call
+relevant test

* Update golangci/golangci-lint-action action to v6 (#170)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update GitHub Actions (#144)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update module github.com/google/go-github/v53 to v62 (#173)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update all non-major dependencies (#136)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(automerge): implement exponential backoff (#181)

* fix(automerge): implement exponential backoff

* Update internal/pkg/githubapi/github.go

* Fix > 250 char Branch name issue (#188)

* Fix > 250 char Branch name issue

Move branch name generation to a function.
Limit original branch substing to 200 charts
Switch target paths substring to sha1 of the target paths.
Tests

* Address issues raised in PR review:

Rename a var
Used Repeat to avoid hardcoding long string
Made some test input **a bit** more realistic

* Cleanup some conflict marker and add comment

* Fix some merge bug

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benas Taurosevičius <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automerge fails on some PRs when there are multiple PRs being merged in very short period of time
2 participants